home *** CD-ROM | disk | FTP | other *** search
- /*//////////////////////////////////////////////////////////////////////
- Filename: wsn-edit-dialogs.js
- Company Name: Computer Associates International, Inc.
- Legal Copyright: Copyright (c) Computer Associates International, Inc.
- Author: Marek Matus (marek.matus@ca.com)
- Product: Tiny Firewall
- Description: functions for showing various dialogs for SBX
- ///////////////////////////////////////////////////////////////////////*/
-
- function editWSRuleByID( strRuleID )
- {
- var bClientRule = !isWSServerRuleID( strRuleID );
- var eObjType = WS_getRuleType( strRuleID );
- var strObjectType = WS_getStrObjType( eObjType );
- var strATParams = WS_getATParams( eObjType );
- var strAccHdr = WS_getStrAccHdr( eObjType );
- var strObjHdr = WS_getStrObjHdr( eObjType );
-
- var rule = WS_getRule( strRuleID, bClientRule);
- if ( !rule )
- {
- alert(getStr('','STR_EDIT_EVENT_DELETED'));
- return
- }
-
- processMsgOKNotShow('event_edit_warning', getStr('','STR_EDIT_EVENT_WARNING'), getStr('','STR_EDIT_EVENT_NOT_SHOW_AGAIN'), getStr('','STR_EDIT_EVENT_WARNING_TITLE'));
-
- if ( isProVersion() ) // client x server db.
- {
- OnEditRule( strRuleID, bClientRule, strObjectType, eObjType, strATParams, strObjHdr, strAccHdr, true );
- }
- else
- {
- if ( isWSServerRuleID(strRuleID) )
- {
- OnEditRule( strRuleID, bClientRule, strObjectType, eObjType, strATParams, strObjHdr, strAccHdr, true );
- }
- }
- }
-
- function isWSServerRuleID( strRuleID )
- {
- return ( strRuleID.substr(1,1) == 'S');
- }
-
- function WS_getStrObjType( eObjType )
- {
- switch ( eObjType )
- {
- case OT_FILE: return STR_OBJ_TYPE_FILE;
- case OT_SERVICE: return STR_OBJ_TYPE_SERVICE;
- case OT_REGISTRY: return STR_OBJ_TYPE_REGISTRY;
- case OT_SPAWNING: return STR_OBJ_TYPE_SPAWNING;
- case OT_DEVICE: return STR_OBJ_TYPE_DEVICE;
- case OT_COMOBJECT: return STR_OBJ_TYPE_OLECOM;
- case OT_SYSTEMPRIV: return STR_OBJ_TYPE_SYSPRIV;
- case OT_SPAWN_DLL: return STR_OBJ_TYPE_DLLLOAD;
- default: return '';
- }
- }
-
- function WS_getRuleType( strRuleID )
- {
- switch ( strRuleID.substr(0,1) )
- {
- case 'F': return OT_FILE;
- case 'R': return OT_REGISTRY;
- case 'D': return OT_DEVICE;
- case 'C': return OT_COMOBJECT;
- case 'Y': return OT_SYSTEMPRIV;
- case 'P': return OT_SPAWNING;
- case 'L': return OT_SPAWN_DLL;
- case 'S': return OT_SERVICE;
- default: return 0;
- }
- }
-
-